package com.example.Dietproject.User.servlce;

import com.example.Dietproject.User.dao.UserMapper;
import com.example.Dietproject.User.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServlceImpl implements UserServlce {

    @Autowired
    private UserMapper userMapper;
    @Override
    public User selectByLogin(User user) {
        if (user==null||"".equals(user.getUaccount())||"".equals(user.getUpassword())){
            return null;
        }
        try {
            User loginUser =  userMapper.selectByLogin(user);
            return loginUser;
        }catch (Exception e){
            System.out.println(e.getMessage());
        }
        return  null;
    }
}
